/*
 * This file is part of Smart Route for S60 3rd Edition terminals
 * 
 * Copyright (C) 2006  Harri Salminen

 * This program free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 *(at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#ifndef ExportRoute_H
#define ExportRoute_H

#include <e32std.h>
#include <e32base.h>
#include "SmartRouteDataStore.h"

_LIT8(KXMLHeader, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
_LIT8(KKMLHeader,"<kml xmlns=\"http://earth.google.com/kml/2.0\">\n");
_LIT8(KKMLClose, "</kml>\n");
_LIT8(KPlacemark, "<Placemark>\n");
_LIT8(KPlacemarkClose, "</Placemark>\n");
_LIT8(KName,"<name>\n");
_LIT8(KNameClose,"</name>\n");
_LIT8(KDescription, "<description>\n");
_LIT8(KDescriptionClose, "</description>\n");
_LIT8(KLookAt, "<LookAt>\n");
_LIT8(KLookAtClose, "</LookAt>\n");
_LIT8(KStyle, "<Style>\n");
_LIT8(KStyleClose, "</Style>\n");
_LIT8(KLineStyle, "<LineStyle>\n");
_LIT8(KLineStyleClose, "</LineStyle>\n");
_LIT8(KPolyStyle, "<PolyStyle>\n");
_LIT8(KPolyStyleClose, "</PolyStyle>\n");
_LIT8(KLineString, "<LineString>\n");
_LIT8(KLineStringClose, "</LineString>\n");

_LIT8(KLongitude,"<longitude>\n");
_LIT8(KLongitudeClose,"</longitude>\n");
_LIT8(KLatitude, "<latitude>\n");
_LIT8(KLatitudeClose, "</latitude>\n");
_LIT8(KRange, "<range>\n");
_LIT8(KRangeClose, "</range>\n");
_LIT8(KTilt, "<tilt>\n");
_LIT8(KTiltClose, "</tilt>\n");
_LIT8(KHeading, "<heading>\n");
_LIT8(KHeadingClose, "</heading>\n");
_LIT8(KVisibility, "<visibility>\n");
_LIT8(KVisibilityClose, "</visibility>\n");
_LIT8(KOpen, "<open>\n");
_LIT8(KOpenClose, "</open>\n");
_LIT8(KColor, "<color>\n");
_LIT8(KColorClose, "</color>\n");
_LIT8(KWidth, "<width>\n");
_LIT8(KWidthClose, "</width>\n");
_LIT8(KExtrude, "<extrude>\n");
_LIT8(KExtrudeClose, "</extrude>\n");
_LIT8(KTessellate, "<tessellate>\n");
_LIT8(KTessellateClose, "</tessellate>\n");
_LIT8(KAltitudeMode, "<altitudeMode>\n");
_LIT8(KAltitudeModeClose, "</altitudeMode>\n");
_LIT8(KCoordinates, "<coordinates>\n");
_LIT8(KCoordinatesClose, "</coordinates>\n");

class CExportRoute : public CBase
{ 
public: 
	~CExportRoute();
	static CExportRoute* NewL(CSmartRoute& aRoute);
	static CExportRoute* NewLC(CSmartRoute& aRoute);

	TPtr8 ExportRouteL();
	
private:
	CExportRoute(CSmartRoute& aRoute);
	void ConstructL();
	
	void AddL(const TDesC8& aData);
	void AddL(const TDesC16& aData);
	
private: //Data
	CSmartRoute& iRoute;
	CBufFlat* iExportedRoute;
};

#endif // ExportRoute_H
